package itesm.coler.models;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.xml.bind.annotation.XmlRootElement;

@SuppressWarnings("serial")
@PersistenceCapable
@XmlRootElement
public class User implements Serializable {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	private String encodedKey;

	@Persistent
	@Extension(vendorName = "datanucleus", key = "gae.pk-name", value = "true")
	private String userName;

	@Persistent
	private String firstName;

	@Persistent
	private String middleName;

	@Persistent
	private String lastName;

	@Persistent
	private char gender;

	@Persistent
	private Date dateOfBirth;

	@Persistent
	private boolean active;

	@Persistent
	private boolean online;

	@Persistent
	private String userType;
	
	@Persistent
	private String pass;
	
	public User() {
	}

	public User(String userName, String userType) {
		this.userName = userName;
		this.userType = userType;
	}

//	public User(String userName, String firstName, String middleName,
//			String lastName, char gender, Date dateOfBirth, boolean active,
//			boolean online, String userType) {
//		this.userName = userName;
//		this.firstName = firstName;
//		this.middleName = middleName;
//		this.lastName = lastName;
//		this.gender = gender;
//		this.dateOfBirth = dateOfBirth;
//		this.active = active;
//		this.online = online;
//		this.userType = userType;
//
//	}
	
	public User(String userName, String firstName, String middleName,
			String lastName, char gender, boolean active,
			boolean online, String userType) {
		this.userName = userName;
		this.firstName = firstName;
		this.middleName = middleName;
		this.lastName = lastName;
		this.gender = gender;
//		this.dateOfBirth = dateOfBirth;
		this.active = active;
		this.online = online;
		this.userType = userType;

	}

	// Getters & Setters

	public String getUserEncodedId() {
		return encodedKey;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getMiddleName() {
		return middleName;
	}

	public void setMiddleName(String middleName) {
		this.middleName = middleName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public char getGender() {
		return gender;
	}

	public void setGender(char gender) {
		this.gender = gender;
	}

	public Date getDateOfBirth() {
		return dateOfBirth;
	}

	public void setDateOfBirth(Date dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public boolean isOnline() {
		return online;
	}

	public void setOnline(boolean online) {
		this.online = online;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public String getPass() {
		return pass;
	}

	public void setPass(String pass) {
		this.pass = pass;
	}
}